#include <stdio.h>

//lapacke headers
#include "lapacke.h"
#include "lapacke_config.h"
#include "lapacke_utils.h"

extern lapack_int LAPACKE_dgeev( int matrix_order, char jobvl, char jobvr,
                          lapack_int n, double* a, lapack_int lda, double* wr,
                          double* wi, double* vl, lapack_int ldvl, double* vr,
                          lapack_int ldvr );

int main(){
    
    int matrix_order = LAPACK_COL_MAJOR;
    char jobvl = 'N';
    char jobvr = 'V';
    int n = 50;
    double A[50][50];
    for(int i = 0; i < 50; i++)
    {
        for(int j = 0; j < 50; j++)
        {
            if(i == j) A[i][j] = i;
            else A[i][j] = 0;
        }
    }
    int lda = n;
    double wr[50] = {0};
    double wi[50] = {0};
    double vl[2500];
    int ldvl = 50;
    double vr[2500];
    int ldvr = 50;

    int info = LAPACKE_dgeev(matrix_order,jobvl,jobvr,n,A,lda,wr,wi,vl,ldvl,vr,ldvr);
    if(info==0){ 
        int i = 0;
        int j = 0;
        for(i=0;i<50;i++){
            printf("eigenvalue :");
            printf("%lf \n",wr[i]);
        }
        printf("SUCCESS\n");
    }
    return 0;
}